package com.shockweb.common.context;

import java.util.HashMap;

/**
 * 微服务客户端向服务端亲求的公共参数
 * @author 彭明华
 *
 */
public class ContextParam extends HashMap<String,Object>{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7365063678031067293L;
	/**
	 * 构造方法
	 */
	public ContextParam(){
		
	}
	
	/**
	 * 构造函数
	 * @param uuid
	 */
	public ContextParam(String uuid){
		this.put(ContextManager.UUID, uuid);
	}
	
	/**
	 * 构造函数
	 * @param uuid
	 */
	public ContextParam(String uuid,String owner){
		this.put(ContextManager.UUID, uuid);
		if(owner!=null){
			this.put(ContextManager.OWNER, owner);
		}
	}

    /**
     * 获取每次调用的UUID
     * @return
     */
    public String getUuid(){
        return (String)this.get(ContextManager.UUID);
    }
    
    /**
     * 获取Owner
     * @return
     */
    public String getOwner(){
    	if(this.get(ContextManager.OWNER)==null){
    		return null;
    	}else{
    		return (String)this.get(ContextManager.OWNER);
    	}
    }

}
